#ifndef COMMON_H
#define COMMON_H

#include "lwip/mem.h"
#include "lwip/sockets.h"
#include "stdarg.h"
#include "lstring.h"

#define NULL 0
typedef int size_t; 
typedef unsigned int u_int;

int snprintf(char *str, size_t size, const char *format, ...);
int strcmp(const char *s1, const char *s2);
int strncmp(const char *s1, const char *s2, size_t n);
char *strdup(const char *s);
void bzero(void *s, size_t n);

void *malloc(size_t size);
void free(void *ptr);

#define skyeye_printf print


//#define DEBUG_LIBHTTPD
#undef DEBUG_LIBHTTPD
#ifdef DEBUG_LIBHTTPD
//#define debug_libhttpd(str,arg...) print(str"\n",##arg)
#define debug_libhttpd(str,arg...) print("%s:%d - "str"\n",__FILE__,__LINE__,##arg)
#else
#define debug_libhttpd(str,...)
#endif



/*
int socket(int domain, int type, int protocol);
int bind(int sockfd, const struct sockaddr *addr,socklen_t addrlen);
int listen(int sockfd, int backlog);
time_t time(time_t *t);
*/


#endif
